import request from './request'
/**
 * 
 * @param {*} params 
 * @returns 
 * 商品列表
 */
export const goodsList = (params) => {
    return request({
        url: '/Goods',
        method: 'get',
        params
    })
}
/**
 * 添加商品
 */
export const goodsAdd = (params) => {
    return request({
        url: '/Goods/create',
        method: 'get',
        params,
        headers: {
            'Content-Type': 'multipart/form-data',
        }
    })
}
/**
 * 
 * @param {*} id 
 * @param {*} params 
 * @returns 
 * 编辑商品
 */
export const goodsEdit = (id, params) => {
    return request({
        url: `/Goods/${id}`,
        method: 'put',
        params
    })
}
/**
 * 
 * @param {*} id 
 * @returns 
 * 查看商品详情
 */
export const goodsDetali = (id) => {
    return request({
        url: `/Goods/${id}`,
        method: 'get',
    })
}
/**
 * 
 * @param {*} id 
 * @returns 
 * 删除商品
 */
export const goodsRemove = (id) => {
    return request({
        url: `/Goods/${id}`,
        method: 'delete',
    })
}